package app

import (
	"d-serv-go/server/core/bean"
	"d-serv-go/server/core/comm"
	"sync"

	"d-serv-go/server/core/db"
	"d-serv-go/server/core/dict"
	"d-serv-go/server/core/menu"
	"d-serv-go/server/core/org"
	"d-serv-go/server/core/serv"
	"d-serv-go/server/core/vars"
	"encoding/gob"
)

func StartOn() {
	//
	gob.Register([]*bean.Bean{})
	gob.Register(&bean.Bean{})
	gob.Register(sync.RWMutex{})

	db.ServMgr = serv.NewServMgr()
	db.VarMgr = vars.NewVarMgr()
	db.DictMgr = dict.NewDictMgr()
	db.ServDao = serv.NewServDao()
	db.UserMgr = org.NewUserMgr()
	db.OrgMgr = org.NewOrgMgr()
	db.RoleMgr = org.NewRoleMgr()
	db.MenuMgr = menu.NewMenuMgr()
	db.AclMgr = org.NewAclMgr()
	db.DataAclMgr = org.NewDataAclMgr()


	if !comm.IsProd() {
		return
	}
	// 开启定时任务
	startSchedule()
}
